
<div class="detail">
	<ul class="nav nav-tabs">
	  <li style="margin-left:30px;" class="active"><a role="tab" data-toggle="tab" class="font14" href="#profile">Profile</a></li>
	  {{if $model_item['status']==3}}
	  <li><a class="font14" href="{{$this->Html->url('/admin/partners/tasks/'.$partner_id)}}?status=13,14">Current Tasking</a></li>
	  <!-- <li {{if $_REQUEST['status']=='10,11'}}class="active"{{/if}}><a  role="tab" data-toggle="tab" class="font14" href="{{$this->Html->url('/admin/partners/tasks/'.$partner_id)}}?status=10,11">Bid Tasking</a></li> -->
	  <li><a class="font14" href="{{$this->Html->url('/admin/partners/tasks/'.$partner_id)}}?status=15">Finished Tasks</a></li>
	  {{/if}}
	</ul>
	
	
	<h3 class="name">{{$model_item['name']}}</h3>
	<div class="detail bg1 bbline1 btline2">
		<p>{{$model_item['summary']}}</p>
		
		{{if $model_item['status']==0}}
			<div class="alert alert-warning">not apply audit.</div>
			&nbsp;
			
		{{elseif $model_item['status']==1}}
			{{$this->Html->link(lang('pass audit'), 
								'/admin/partners/audit/pass/'.$partner_id, 
								array( 'class'=> 'btn btn-default btn-warning','escape'=>false,
							)
							);
						}}&nbsp;
				{{$this->Html->link(lang('refuse audit'), 
								'/admin/partners/audit/refuse/'.$partner_id, 
								array( 'class'=> 'btn btn-default btn-warning','escape'=>false,
							)
							);
						}}
		
		{{elseif $model_item['status']==2}}
			<div class="alert alert-warning">been refused audit.</div>
			&nbsp;
		{{elseif $model_item['status']==3}}
			<div class="alert alert-warning">passed audit.</div>
			&nbsp;
				
		{{/if}}		 
	</div>
	<hr/>
			
	<div>
  		<div id="profile">
			<portlet portlet="default" list_tpl="inner" cache="no" title="{{lang('job_experiences')}}" model="JobExperience" recursive="0" info="limit=12&conditions[creator]=$partner_user_id&order=start_date desc">
				<li>
					<h4>{{$item['name']}} </h4>
					<small>{{$item['company_name']}}</small>
					<p>{{$item['start_date']}}~{{$item['end_date']}} | {{$item['location']}}</p>
						
					<p>{{$item['description']}}</p>
				</li>
			</portlet>
			<hr/>
			<table class="table">				
					<tr><td colspan="4">
						{{lang('skills')}}: 			
						{{loop $datainfo['Tag'] $tag}}
							<span class="label label-default">{{$tag['name']}}</span> 
						{{/loop}}
					</td></tr>
					
					<tr><td colspan="4">
						<div class="row">
						{{loop $datainfo['Uploadfile'] $file}}
							<div class="col-sm-3">
							{{if strpos($file['type'],'image')!==false}}
								<a href="/uploadfiles/download/{{$file['id']}}" target="_blank"><img src="{{$file['thumb']}}"/></a>
								<a href="/uploadfiles/download/{{$file['id']}}" class="btn btn-default" target="_blank">{{$file['name']}}</a>
							{{else}}
								<a href="/uploadfiles/download/{{$file['id']}}" class="btn btn-default" target="_blank">{{$file['name']}}</a>
							{{/if}}
							</div>
						{{/loop}}
						</div>		
					</td></tr>
			</table>
		</div>
		<div id="running-task">

			
					{{loop $tasks $task}}
						<div style="margin:30px 30px;" class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">{{$this->Html->link(usubstr($task['Task']['name'],0,24), 
										'/admin/tasks/view/'.$task['Task']['id'], 
										array('title'=>$task['Task']['name'],'target'=>'_blank','escape'=>false)
									);
								}}</h3>
				  </div>
				  <div class="panel-body">
				    	
								<?PHP  $task_id = $task['Task']['id'];$finished_executes = 0; $total_executes = 0;?>
								<portlet list_tpl="inner" id="user-task-plan" portlet="body" cache="no" title="{{lang('tasking_plan')}}" model="TaskExecute" recursive="0" info="limit=12&conditions[task_id]=$task_id&conditions[user_id]=$current_user_id&order=start_date asc">
										<?PHP $total_executes ++;
				if($item_all['TaskExecute']['status'] >= 2){
					$finished_executes ++ ;
				}
					 ?>
								</portlet>
								<?PHP if($total_executes){ $step_progress = ceil($finished_executes*100/$total_executes);} ?>
								<div class="bbline1"><!--detail-0 start-->
				              <table class="table4">
				                <tbody>
				                <tr>
				                  <td style="width:10%" class="th1">Progress:</td>
				                  <td style="text-align:center; width:10%" class="th1">{{$step_progress}}%</td>
				                  <td>
				                    <div class="progress nomb">
				                      <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: {{$step_progress}}%">
				                        <span class="sr-only"></span>
				                      </div>
				                    </div>
				                  </td>
				                </tr>
				              </tbody></table>
							</div>
							<table class="table">
							<tr><td>
								<p style="height:16px;"><small><strong>Time period:</strong> {{substr($task['Task']['start_time'],0,10)}} ~ {{substr($task['Task']['end_time'],0,10)}}</small></p>
								</td>
								<td style="width:180px;">
								{{$task['Task']['price_des']}}
								</td>		
								</tr>
								<tr>
								<td colspan="2">
								{{$task['Task']['content']}}
								
								{{if $step_progress==100}}
						       		<div>
						       			{{if $task['Tasking']['status'] == 14}}
							       			<a class="btn btn-primary" href="{{$this->Html->url('/tasks/finished/'.$task['Task']['id'].'/'.$task['Tasking']['id'])}}">{{lang('finished_task')}}</a>
							       		{{elseif $task['Tasking']['status'] == 15}}
							       			{{lang('finished,wait confirm.')}}
							       		{{elseif $task['Tasking']['status'] == 16}}
							       			{{lang('confirm_finished')}}
							       		{{/if}}
						       		</div>
						       	{{/if}}
						       
								</td>
								</tr>
							<tr><td colspan="2">
								{{loop $data_array $item_all}}
									<div>
									<h3 style="padding:10px 0px; font-size:18px;">{{$item_all['TaskExecute']['name']}}</h3>
									<?php $progress = get_time_process($item_all['TaskExecute']['start_date'],$item_all['TaskExecute']['end_date']);  ?>
									<div class="progress nomb">
				                      <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: {{$progress}}%">
				                        <span class="sr-only"></span>
				                      </div>
				                    </div>
				                    
									<div>
						                  <strong>Time period:</strong> {{$item_all['TaskExecute']['start_date']}} ~ {{$item_all['TaskExecute']['end_date']}}
						                  	<!-- <div class="col-md-6"><strong>progress rate:</strong> Report Solution</div> -->
						            </div>
						            </div>
								{{/loop}}
							</td></tr>
								
						</table>
				  </div>
				</div>
					
								
					{{/loop}}
		</div>
	</div>			
					
</div>
